/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: ApiInceptor
 * Author:   sjkyll
 * Date:     2018-07-27 12:59
 * Description: 拦截器
 * <author>          <time>          <version>          <desc>
 * 作者姓名         修改时间           版本号            描述
 */
package com.cdqidi.smsservice.inceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author sjkyll
 * @create 2018-07-27 12:59
 * @since 1.0.0
 */
@Configuration
public class GlobalWebMvcConfigurer implements WebMvcConfigurer {
   @Autowired
   private AuthProcessIntercept authProcessIntercept;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加一个拦截器，拦截以/api为前缀的 url路径
        registry.addInterceptor(authProcessIntercept).addPathPatterns("/api/**");
        registry.addInterceptor(authProcessIntercept).addPathPatterns("/cache/**");
    }
}